# 时间函数举例2


# !/usr/bin/python
# -*- coding: UTF-8 -*-

if __name__ == '__main__':
    import time

    # time.time() Return the current time in seconds since the Epoch
    start = time.time()
    for i in range(3000):
        print(i)
    end = time.time()

    print(f"花费时间{end - start}秒")

    # 1s = 1000000000纳秒 10亿纳秒
    start_ns = time.time_ns()
    for i in range(3000):
        print(i)
    end_ns = time.time_ns()
    print(f"花费时间{end_ns - start_ns}纳秒")
